import type { AlarmRecordModel } from './models';

import { requestClient } from '#/api/request';

/**
 * 分页查询设备警报记录数据集合
 * @param params 分页查询参数
 * @returns 返回查询结果
 */
export async function getAlarmRecordPagedListApi(params?: PageParams) {
  return requestClient.get<PaginationResult<AlarmRecordModel>>(
    '/mes/equipment/alarmRecord/list-page',
    {
      params,
    },
  );
}

/**
 * 关闭设备警报记录
 * @param id 警报记录 Id
 * @returns 返回结果
 */
export async function closeAlarmRecordApi(id: number) {
  return requestClient.put<boolean>(`/mes/equipment/alarmRecord/close/${id}`);
}
